define(["app", "angular", "services/BaseService"], function(app, angular) {
	
	var deps = ["$http", "BaseService"];
	
	function merchantManagementResource($http, BaseService) {
        return initResource($http, BaseService.restfulUrl + "merchant/", BaseService.formHeader);
    }
	
	var postHeader = {
	        "Content-Type" : "application/x-www-form-urlencoded;charset=utf-8"
	};
	
	function initResource($http, preUrl,formHeader) {
        return {
        	queryCompanyByCode: function (companyCode) {
                return $http.get(preUrl + "queryCompanyByCode", {
                    params: {
                    	companyCode: companyCode
                    }
                });
            },
            
            updatePassword: function (userId,oldpassword,newpassword) {
                return $http.get(preUrl+"updatePassword", {
                    params: {
                    	userId: userId,
                    	oldpassword:oldpassword,
                    	newpassword:newpassword
                    }
                });
            },
            queryMerchantList: function (currentPage,pageSize,merchantKey) {
                return $http.get(preUrl+"queryMerchantList", {
                    params: {
                    	currentPage: currentPage,
                    	pageSize:pageSize,
                    	merchantKey:merchantKey
                    }
                });
            },
        };
        
    }
	merchantManagementResource.$inject = deps;
	app.lazy.factory("MerchantManagementResource", merchantManagementResource);
});
